package com.demo.day528;

import java.util.Scanner;

/**
 * @Auther: MFM
 * @Date: 2021/5/28 - 05 - 28 - 19:06
 * @version: 1.0
 */

public class AtmManager {
    public void run() {

        ATM atm = new ATM();

        Scanner scanner = new Scanner(System.in);

        boolean login = atm.login(scanner);

        while (login) {
            System.out.println("==============");
            System.out.println("欢迎使用银行系统");
            System.out.println("1、查询余额");
            System.out.println("2、取款");
            System.out.println("3、存款");
            System.out.println("4、转账");
            System.out.println("5、修改密码");
            System.out.println("6、退出");
            System.out.println("7、切换用户");
            System.out.println("8、显示交易信息");
            System.out.println("==============");
            String choice = scanner.next();

            atm.getType(choice);

            switch (choice) {
                case "1": {
                    atm.showMoney();
                    break;
                }
                case "2": {
                    atm.Withdraw(scanner);
                    break;
                }
                case "3": {
                    atm.Deposit(scanner);
                    break;
                }
                case "4": {
                    atm.turnMoney(scanner);
                    break;
                }
                case "5": {
                    atm.changePassWord(scanner);
                    break;
                }
                case "6": {
                    atm.exit();
                    break;
                }
                case "7":{
                    atm.ChangeUser(scanner);
                    break;
                }
                case "8":{
                    atm.TradeInformation();
                    break;
                }
                default: {
                    System.out.println("输入错误，请重新输入！");
                    break;
                }
            }
        }

    }
}
